<?php
/**
 * Created by dutuwang.net
 * User: adophper <hello@adophper.com>
 * Date: 2018/4/4
 * Time: 9:39
 */
use yii\helpers\Html;

$this->title = Yii::t('frontend', 'my_center');
?>
<?=Html::cssFile('/static/frontend/css/center.css')?>
<?=Html::jsFile('/static/frontend/js/swipe.js')?>
<!--个人中心内容盒子-->
<div class="contBox">
    <div class="center_box row">
        <?=$this->render('left')?>
        <div class="col-md-10 right_min" style="padding-left: 0;">
            <div class="right_box ucenter-index-right-top">
                <div class="c_index_top flex f_around">
                    <span class="c_index_top_icon flex f_center">
                        <img src="<?=$user->avatar?>" onerror="this.src='/static/frontend/image/noavatar.png';"/>
                    </span>
                    <div class="c_index_top_min flex">
                        <div class="c_index_top_min_item">
                            <h5 class="flex"><strong><?=empty($user->realname)?$user->username:$user->realname?></strong></h5>
                            <p class="flex"><label class="t_o">账号安全：</label>
                                <span class="progress">
                                  <em class="progress-bar" role="progressbar" aria-valuenow="<?=$safety_grade?>" aria-valuemin="0" aria-valuemax="100" style="width: <?=$safety_grade?>%;">
                                    <i class="sr-only"><?=$safety_grade?>% Complete</i>
                                  </em>
								</span>
                            </p>
                            <p class="flex"><label class="t_o">消息提醒：</label><em class="t_o">全部(<?=$messageRemind['all_count']?>)</em><em class="t_red t_o">未读(<?=$messageRemind['not_read']?>)</em></p>
                            <p class="flex"><label class="t_o">我的积分：</label><em><?=$user->integral?></em></p>
                        </div>
                        <div class="c_index_top_min_item item_indent">
                            <h5 class="flex"><label><i class="iconfont">&#xe621;</i></label>手机号码(<?=$user->is_mobile_verify?'已验证':'未验证'?>)</h5>
                            <p class="flex"><label></label><em><?=$user->mobile?></em></p>
                            <p class="flex"><label></label><a href="<?=Yii::$app->urlManager->createUrl(['member/info'])?>" class="t_bule">修改</a></p>
                            <p class="flex"><label></label></p>
                        </div>
                        <div class="c_index_top_min_item item_indent">
                            <h5 class="flex t_o"><label><i class="iconfont large">&#xe646;</i></label>邮箱绑定(<?=$user->is_email_verify?'已验证':'未验证'?>)</h5>
                            <p class="flex"><label></label><em><?=$user->email?></em></p>
                            <p class="flex"><label></label><a href="<?=Yii::$app->urlManager->createUrl(['member/info'])?>" class="t_bule">修改</a></p>
                            <p class="flex"><label></label></p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="fbox c_index_min">
                <div class="fl">
                    <div class="white_box left_min">
                        <div class="his_title flex f_between"><label>我关注的展会</label><span><a href="<?=Yii::$app->urlManager->createUrl(['member/follow'])?>">查看全部关注&gt;</a></span></div>
                        <div class="follow_list">
                            <?php
                            if (!empty($myFollow)) {
                            ?>
                            <div class="follow-nav swipe-nav swipe-nav-left">
                                <div class="swipe-nav-bar follow-prev"><i class="iconfont">&#xe65d;</i></div>
                            </div>
                            <div class="swipe" id="slider">
                                <div class="swipe-wrap">
                                    <div class="left_min_list pull-left">
                                        <div class="clearfix">
                                        <?php
                                            $i = 1;
                                            $myFollowCount = count($myFollow);
                                            foreach ($myFollow as $val) {
                                        ?>
                                        <div class="pull-left min_list_item_box">
                                            <div class="f_relative">
                                                <a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>"><img src="<?=$val['litpic']?>_184x150.jpg" alt="<?=$val['title']?>" /></a>
                                                <p class="t_o"><a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>"><?=$val['title']?></a></p>
                                            </div>
                                            <p class="flex t_o"><i class="t_red iconfont">&#xe615;</i><?=$val['show_start']?> 至 <?=$val['show_end']?></p>
                                            <p class="flex"><i class="t_red iconfont">&#xe620;</i><?=$val['city']?></p>
                                        </div>
                                        <?php
                                                if ($i % 4 == 0 && $i < $myFollowCount) {
                                        ?>
                                        </div></div><div class="left_min_list pull-left"><div class="clearfix">
                                            <?php
                                                }
                                                $i ++;
                                            }
                                        ?>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="follow-nav swipe-nav swipe-nav-right">
                                <div class="swipe-nav-bar follow-next"><i class="iconfont">&#xe617;</i></div>
                            </div>
                            <script>
                                var slider = Swipe(document.getElementById('slider'), {
                                    auto: 3000,
                                    continuous: true,
                                    callback: function(pos) {}
                                });
                                $(function(){
                                    $(".follow-prev").click(function(e){
                                        e.preventDefault();
                                        slider.prev();
                                    });
                                    $(".follow-next").click(function(e){
                                        e.preventDefault();
                                        slider.next();
                                    });
                                });
                            </script>
                            <?php
                            }else{
                            ?>
                            <p class="text-center" style="padding: 20px 0">暂无数据！</p>
                            <?php
                            }
                            ?>
                        </div>
                    </div>
                    <div class="white_box left_min">
                        <div class="his_title flex f_between"><label>展会浏览历史</label><span><a href="<?=Yii::$app->urlManager->createUrl(['member/history'])?>">查看全部历史&gt;</a></span></div>
                        <div class="history_list">
                            <div class="history-nav swipe-nav swipe-nav-left">
                                <div class="swipe-nav-bar history-prev"><i class="iconfont">&#xe65d;</i></div>
                            </div>
                            <div class="swipe" id="slider2">
                                <div class="swipe-wrap">
                                    <div class="left_min_list pull-left">
                                        <div class="clearfix">
                                        <?php
                                        if (!empty($history)) {
                                            $i = 1;
                                            $historyCount = count($history);
                                            foreach ($history as $val) {
                                        ?>
                                        <div class="pull-left min_list_item_box">
                                            <div class="f_relative">
                                                <a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>"><img src="<?=$val['litpic']?>_184x150.jpg" alt="<?=$val['title']?>" /></a>
                                                <p class="t_o"><a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>"><?=$val['title']?></a></p>
                                            </div>
                                            <p class="flex t_o"><i class="t_red iconfont">&#xe615;</i><?=$val['show_start']?> 至 <?=$val['show_end']?></p>
                                            <p class="flex"><i class="t_red iconfont">&#xe620;</i><?=$val['city']?></p>
                                        </div>
                                        <?php
                                                if ($i % 2 == 0 && $i < $historyCount) {
                                            ?>
                                            </div></div><div class="left_min_list pull-left"><div class="clearfix">
                                            <?php
                                                }
                                                $i++;
                                            }
                                        }
                                        ?>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="history-nav swipe-nav swipe-nav-right">
                                <div class="swipe-nav-bar history-next"><i class="iconfont">&#xe617;</i></div>
                            </div>
                            <script>
                                var slider2 = Swipe(document.getElementById('slider2'), {
                                    auto: 3000,
                                    continuous: true,
                                    callback: function(pos) {}
                                });
                                $(function(){
                                    $(".history-prev").click(function(e){
                                        e.preventDefault();
                                        slider2.prev();
                                    });
                                    $(".history-next").click(function(e){
                                        e.preventDefault();
                                        slider2.next();
                                    });
                                });
                            </script>
                        </div>
                    </div>
                </div>
                <div class="fr">
                    <div class="white_box right_min">
                        <div class="his_title flex f_between"><label>展会推荐</label><a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/index'])?>">更多&gt;</a></div>
                        <ul class="right_min_list">
                            <?php
                            if (!empty($recommend)) {
                                foreach ($recommend as $val){
                            ?>
                            <li class="f_relative">
                                <a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>"><img src="<?=$val['litpic']?>_250x150.jpg" alt="<?=$val['title']?>" /></a>
                                <p class="t_o t_centers"><a href="<?=Yii::$app->urlManager->createUrl(['zhanhui/detail', 'id'=>$val['id']])?>"><?=$val['title']?></a></p>
                            </li>
                            <?php
                                }
                            }
                            ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>